﻿using Business.ComManagement.Dto;
using Business.ComManagement;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
using Business.DeliveryManagement;
using Business.DeliveryManagement.Dto;

namespace Business.Controllers
{
    [RemoteService]
    [Area("Business")]
    [Route("api/business/delivery")]
    public class DeliveryController : AbpController
    {
        private readonly IDeliveryAppService _DeliveryAppService;

        public DeliveryController(IDeliveryAppService DeliveryAppService)
        {
            _DeliveryAppService = DeliveryAppService;
        }

        [HttpPost]
        [Route("data-post")]
        public Task<DeliveryDto> CreateOrUpdate(CreateOrUpdateDeliveryDto input)
        {
            return _DeliveryAppService.CreateOrUpdate(input);
        }

        [HttpPost]
        [Route("delete")]
        public Task Delete(List<Guid> ids)
        {
            return _DeliveryAppService.Delete(ids);
        }

        [HttpGet]
        [Route("{id}")]
        public Task<DeliveryDto> Get(Guid id)
        {
            return _DeliveryAppService.Get(id);
        }

        [HttpGet]
        public Task<PagedResultDto<DeliveryDto>> GetAll(GetDeliveryInputDto input)
        {
            return _DeliveryAppService.GetAll(input);
        }
    }
}
